package com.liam.rpc.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class RpcProxyServer {

    public void publisher(Object service ,int port){
        ServerSocket serverSocket = null;

        ExecutorService executorService = Executors.newFixedThreadPool(10);
        try {
            serverSocket = new ServerSocket(8080);
            while (true){
                Socket socket = serverSocket.accept();

                executorService.execute(new ProcessorHandler(socket,service));

            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
